From: Gabriel Wicke Date: Thu, 15 Apr 2004 12:27:31 +0000 (+0000) Subject: meta tag fixes X-Git-Tag: 1.3.0beta1~432 X-Git-Url: http://git.cyclocoop.org/wiki/%27.%24skin%5B%27img%27%5D.%27?a=commitdiff_plain;h=896ebbf5bd318caff707acac1aa48cef0c3a2294;p=lhc%2Fweb%2Fwiklou.git meta tag fixes --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4141dcb8e5..7d514cf739 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -579,6 +579,12 @@ class OutputPage { $a = array_merge ( $good , $bad ) ; $a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max $a = implode ( "," , $a ) ; + $strip = array( + "/<.*?>/" => '', + "/[_]/" => ' ' + ); + $a = htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),$a )); + $wgOut->addMeta ( "KEYWORDS" , $a ) ; } @@ -644,8 +650,12 @@ class OutputPage { $ret .= "\n"; if ( count( $this->mKeywords ) > 0 ) { + $strip = array( + "/<.*?>/" => '', + "/[_]/" => ' ' + ); $ret .= "mKeywords ) . "\" />\n"; + htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),implode( ",", $this->mKeywords ))) . "\" />\n"; } foreach ( $this->mLinktags as $tag ) { $ret .= "